/*LICENSE_BEGIN
 * ******************************************************************
 * All original parts of SoccerScope2003 have copyright (2003) by
 * Team YowAI, represented by Mr. Shuhei Shiota
 * The Department of Creative Informatics
 * The Graduate School of Information Science and Technology
 * The University of Tokyo
 * 
 * Additional classes (except libraries in /lib) were developed by 
 * the Dainamite Robocup-Team of the DAI-Labor, TU-Berlin 
 * (www.dai-labor.de)
 * 
 * Extended/new classes/packages are:
 *   soccerscope.analyzer.LogfileAnalyzer
 *   soccerscope.daistatistic.*
 *   soccerscope.daistatistic.charts.*
 *   soccerscope.daistatistic.tools.*
 *   soccerscope.db.*
 *   soccerscope.dialog.*
 *   soccerscope.model.PlayerWorldModel
 *   soccerscope.model.SimplePlayer
 *   soccerscope.net.AgentConnector
 *   soccerscope.training.*
 *   soccerscope.training.conditions.*
 * ******************************************************************
LICENSE_END*/
package soccerscope.training;

import soccerscope.model.PlayMode;

// This class represents the counter for one Condition in the Statistics 
public class TrainingStatsElement {

	private int counter;

	private int index;

	private String name;

	public TrainingStatsElement(int n) {
		super();
		this.index = n;
		// at the beginning, no conditons are counted, so start with 0
		this.counter = 0;
		setName(this.index);
	}

	public void inc() {
		this.counter++;
	}

	public int getIndex() {
		return this.index;
	}

	public int getCounter() {
		return this.counter;
	}

	public String getName() {
		return this.name;
	}

	@Override
	public String toString() {
		return this.name + "(" + this.counter + ")";
	}

	// _____________________________________________________________
	// HELP METHODS
	// _____________________________________________________________

	private void setName(int index) {
		if (index == 0)
			this.name = "TrainingRuns";
		if (index == 1)
			this.name = "CycleCondition";
		if (index == 2)
			this.name = "BallPossessionCondition";
		if (index > 2)
			this.name = PlayMode.toString(index - 3);
		if (index < 0)
			this.name = "";
	}
}